// 用户信息
export default defineComponent({
  name: "AvatarComponent",
  setup() {
    const itemCheckHandler = (val: string) => {
      if (val === "loginOut") {
        loginOutAction();
      }
      if (val === "edit") {
        editAction();
      }
    };
    const loginOutAction = () => {};
    const editAction = () => {};
    return () => (
      <el-dropdown
        trigger="click"
        placement="bottom-end"
        onCommand={itemCheckHandler}
        v-slots={{
          dropdown: () => (
            <el-dropdown-menu>
              <el-dropdown-item command="edit" icon="edit">
                修改密码
              </el-dropdown-item>
              <el-dropdown-item
                command="loginout"
                icon="switchButton"
                class="text-red-500"
              >
                退出
              </el-dropdown-item>
            </el-dropdown-menu>
          ),
        }}
      >
        <div class="flex items-center gap-[10px] w-[140px] justify-end">
          <el-avatar>元丰</el-avatar>
          <div>
            <p class="text-[14px] text-[#666] mb-8px">研发经理</p>
            <p class="text-[12px] text-[#999]">数字科技部</p>
          </div>
          <el-icon class="el-icon--right">
            <arrow-down />
          </el-icon>
        </div>
      </el-dropdown>
    );
  },
});
